<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ include file="common.jsp"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />

<!DOCTYPE html>
<html>
<head>
<title>呼叫</title>
<script src="${ctx}/jiaohao/amq_jquery_adapter.js"></script>
<script src="${ctx}/jiaohao/amq.js"></script>
<script src="${ctx}/jiaohao/jquery.json-2.2.js"></script>
<script type="text/javascript">
	var allList = [];
	var vac01Arr = [];
//消息推送
$(function () {
	var amq = org.activemq.Amq;  
	amq.init({   
	  uri: 'amq', 
	  logging: true,
	  timeout: 5
	}); 
	var myHandler = function (message) {
		var html;
		$("#msgDiv").empty();
		$("#msgDiv").append(unescape(message.data.replace(/\u/g, "%u")).replace("\\",''));
		var msgData = JSON.parse(message.data);
		var list = msgData.list;
		var bas02 = msgData.bas02;
		var obj0 = list[0];
		$("#bas02-left").text(obj0[bas02]);
		//查询医生的信息（照片、简介、级别等）
		$.ajax({
			url:rootUrl + "/clidoctor/selectDataByScriptId",
			type:'get',
			dataType:'json',
			async:false,
			data:{ ID:10000021, paramStr:'{bce01:'+obj0['bce01a']+'}'},
			success:function(data)
			{
				var bce1List = data.list;
				if(bce1List)
				{
					var bce1 = bce1List[0];
					$("#bas03a-left").text(bce1.bce03);//姓名
					$("#aah02-left").text(bce1.aah02);//聘任职务
				}
			}
		});
		for(var i=0;i<list.length;i++)
		{
			var obj = list[i];
			var count = $("#jiaohaoTr").find("tr").length;
			if(count%2==1)
			{
				html = "";
				html += '<tr class="trline01">';
				html += '<td>'+(obj["vaa03"]?obj["vaa03"]:'-')+'</td>';
				html += '<td>'+obj["vaa05"]+'</td>';
				html += '<td>'+obj["bck03"]+'</td>';
				html += '<td>'+(bas02?bas02:'-')+'</td>';
				html += '<td>'+(obj["bce03a"]?obj["bce03a"]:'-')+'</td>';
				html += '</tr>';
			}
			else
			{
				html = "";
				html += '<tr class="trline02">';
				html += '<td>'+(obj["vaa03"]?obj["vaa03"]:'-')+'</td>';
				html += '<td>'+obj["vaa05"]+'</td>';
				html += '<td>'+obj["bck03"]+'</td>';
				html += '<td>'+(bas02?bas02:'-')+'</td>';
				html += '<td>'+(obj["bce03a"]?obj["bce03a"]:'-')+'</td>';
				html += '</tr>';
			}
		}
		$("#jiaohaoTr").html(html);
	}
	var topic = $("#topic").val();
	amq.addListener("smeguangdong","topic://"+topic,myHandler);
});

</script>
<link href="${ctx}/jiaohao/css/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<input type="hidden" id="topic" value="<%=request.getParameter("topic")%>"/>
	<div id="msgDiv" style="display: none;"></div>
	<div id="user" data-info=""></div>
	
    <div class="header">
      <div class="topleft">
      </div> 
         <div class="topcenter1">
         </div> 
      <div class="topright">
        <span></span>
      </div>       
    </div>
    <!--顶部的结束-->
     <div class="formbody">
    <div class="formLeft">
            <div class="title">
            <span id="bas02-left">三诊室</span>
            </div>
            <div class="imgClass">
             <img src="images/tp.png" width="298" height="300" />
            </div>
            <div class="name">
               <span id="bas03a-left">王大仁</span>
            </div>
            <div class="position">
               <span ida="aah02-left">主任医师</span>
            </div>
        </div>
    <div class="formRight">
        <div class="maininfo">
           <table class="imgtable">
            <thead>
            <tr>
                <th width="2%">门诊号</th>
                <th width="2%">姓名</th>
                <th width="5%">科室</th>
                <th width="5%">诊室</th>
                <th width="5%">医生</th>
            </tr>
            </thead>
            <tbody id="jiaohaoTr"></tbody>
            </table>
        </div>
        <div class="marqueeMain">
			<div class="marqueeContent">
			<marquee id="jianjie-left" behavior="scroll" contenteditable="true" onstart="this.firstChild.innerHTML+=this.firstChild.innerHTML;" scrollamount="10" onmouseover="this.stop();" onmouseout="this.start();">
			简介： 消化内科教授、主任医师，医学博士、理学士，博士导师，
			老年示范病房主任。1982年毕业于北京医科大学医疗系，1982
			年毕业于北京医科大学.
			</marquee>
			</div>
        </div>
     </div>
     </div>
   <!--中间区域结束-->
   <div class="footer">
     请在候诊厅等待就诊，保持安静，不要走开，祝您早日康复
   </div>
